package com.alageek.study;

import com.alageek.study.api.impl.HTMLBuilder;
import com.alageek.study.api.impl.TextBuilder;

import java.util.Scanner;

/**
 * 创建者模式
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        if (num == 1) {
            System.out.println("纯文本文档");
            TextBuilder textBuilder = new TextBuilder();
            Director director = new Director(textBuilder);
            director.construct();
            System.out.println(textBuilder.getResult());
        } else if (num == 2) {
            System.out.println("HTML文档");
            HTMLBuilder htmlBuilder = new HTMLBuilder();
            Director director = new Director(htmlBuilder);
            director.construct();
            System.out.println(htmlBuilder.getResult());
        }
    }
}
